<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Constants;

/**
 * 常规变量.
 *
 * Class Constants
 */
class Constants
{
    // 临时文件路径
    public const TMP_PATH = BASE_PATH . '/runtime/tmp/';

    // 资源文件路径
    public const RESOURCE_PATH = BASE_PATH . '/res/';

    // 用户上下文
    public const CONTEXT_USER = 'user';

    // 用户上下文
    public const CONTEXT_USER_ID = 'user_id';

    // 用户类型 是否新用户
    public const CONTEXT_USER_TYPE = 'user_type';

    // 当前路由
    public const CONTEXT_ROUTE = 'current_route';

    // 当前市场
    public const CONTEXT_MARKET_ID = 'current_market_id';

    // 当前语言
    public const CONTEXT_LANGUAGES = 'current_languages';

    // 当前包ID
    public const CONTEXT_PACKAGE_ID = 'current_package_id';

    // 当前通道ID
    public const CONTEXT_AGENT_ID = 'current_agent_id';

    // 错误参数
    public const CONTEXT_ERROR_ARG = 'error_arg';

    // 用户token
    public const AUTHORIZATION = 'Authorization';

    // 请求id
    public const REQUEST_ID = 'Request-Id';

    // 请求时间戳
    public const REQUEST_TIMESTAMP = 'Request-Timestamp';

    // 请求随机数
    public const REQUEST_RANDOM = 'Request-Random';

    // 请求市场
    public const REQUEST_MARKET = 'Request-Market';
    // 设备类型 1=安卓 2=苹果
    public const REQUEST_DEVICE_TYPE = 'Request-Device-Type';

    public const REQUEST_WHITE_TOKEN = 'Request-White-Token';

    // 请求uid
    public const REQUEST_UID = 'Request-Uid';

    // 包标识
    public const REQUEST_PACKAGE_MARK = 'Request-Package-Mark';

    // 请求语言
    public const REQUEST_LANGUAGES = 'Request-Languages';

    /**
     * 鉴权中间件白名单.
     *
     * @var array
     */
    public const AUTH_WHITE_LIST = [
        '/auth/login',
        '/auth/login_email',
        '/auth/firebase_login',
        '/auth/get_token',
        '/auth/get_phone',
        '/recharge/set_drop_order',
        '/auth/send_sms',
        '/auth/send_email',
        '/auth/get_ip',
        '/auth/test',
    ];

    // 返回接口内容解密过滤
    public const RESPONSE_ENCRYPT_WHITE_LIST = [
        '/notify/im',
        '/notify/apply_pay_refund_notice',
        '/game/hk_check_balance',
        '/game/hk_supplement_balance',
    ];

    // 请求加密白名单
    public const REQUEST_DECRYPT_WHITE_LIST = [
        '/notify/im',
        '/notify/apply_pay_refund_notice',
        '/auth/page_send_code',
        '/auth/page_verify_code',
    ];

    // 请求加密白名单
    public const H5_ROUTER = [
    ];

    // 需要检测IP
    public const NEED_CHECK_IP = [
        '/auth/login',
        '/auth/login_email',
        '/auth/firebase_login',
        '/system/open_app_config',
        '/system/config',
        '/user/info',
    ];

    // 图片允许后缀
    public const PIC_EXT = ['png', 'jpg', 'jpeg', 'webp'];

    // 道具类型 // "type":1=金币coin;2=积分score;3=礼物;4=道具;5=钻石;6=家族币,"id":对应id,"num":数量
    public const ITEM_TYPE_TIP = [
        1 => '语豆',
        2 => '积分',
        3 => '礼物',
        4 => '道具',
        9 => 'VIP',
    ];

    public const ITEM_TYPE_UNIT_TIP = [
        1 => '',
        2 => '',
        3 => '个',
        4 => '天',
        9 => '天',
    ];

    // 延迟路由
    public const BLACK_ROUTER = [
        '/recharge/buy',
        '/recharge',
        '/user_recommend',
        '/chat/chat_dialog_info',
    ];

    public const LIMIT_REG_EMAIL = [
        'qq.com',
        '126.com',
        '163.com',
        'alibaba.com',
        'sina.com',
        'shouhu.com',
        '51.com',
    ];

    // 请求主服务器类型枚举
    public const API_REQUEST_TYPE = 1; // 充值掉单枚举
}
